<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
    $("#changeData").change(function(){ 
		var isLoca = $("#isLoca").val(); 
		var isDay = $("#isDay").val(); 
		var isMonth = $("#isMonth").val(); 
		var isYeah = $("#isYeah").val(); 
		var all = isLoca + "-"+  isDay +"-"+ isMonth + "-"+ isYeah ;
		//alert(all);
	  $.ajax({
			type: "POST", 
			url: "/home/loadData", 
			data: "isLoca="+ isLoca+"&isDay="+ isDay+"&isMonth="+ isMonth+"&isYeah="+ isYeah , 
			success: function(answer){
				//alert(answer);
				$('div.success').fadeIn(); 
				$('div.success').html(answer);
			}
		});
    });
	
	
})
</script>
<div class="col-xs-12 col-sm-12" style="padding:0px 0px 20px 0px;">
	<div class="col-xs-3 col-sm-3" style="padding:0px;">
		<img  class="img-rounded" src="/img/loto.png">
	</div>
	<div class="col-xs-9 col-sm-9" style="padding:0px;">
		<p class="title-text">lotobest</p>
		<div class="text-detail">
		Tường thuật trực tiếp kết quả xổ số, Dự đoán kết quả, soi cầu,
		thống kê Lô tô, phân tích cặp số may mắn nhất trong ngày
		
		</div>
	</div>
</div>

<div class="col-xs-12 col-sm-12 bg-ruler" style="padding:0px;">
<p class="title-xoso">kết quả xổ số</p>
<form id="changeData" class="form-horizontal form-infor" role="form">
  <div class="form-group">
    <label for="inputEmail3" class="col-sm-5 control-label">Kết quả sổ xố</label>
    <div class="col-sm-5">
      <select class=" form-control  input-sm" id="isLoca" style="width:80%">
		  <?php 
			foreach($regions as $re){?>
			<option value="<?php echo $re['Region']['ID']?>"><?php echo $re['Region']['NAME']?></option>
			<?php } ?>
		  
	  </select>
    </div>
  </div>
  <div class="form-group">
    <label for="inputPassword3" class="col-sm-3 control-label">Ngày</label>
    <div class="col-sm-9">
      <select class="show-info   form-control  input-sm" id="isDay">
		  <?php 
			for($n=1;$n<=31;$n++){
				if($n<10)$n = "0".$n;?>
				 <option value="<?php echo $n;?>" <?php if($n==$isDay) { echo 'selected="selected"';}?>><?php echo $n;?></option>
			<?php }?>
		 
		  
	  </select>
	  
	  <select class=" show-info  form-control  input-sm" id="isMonth">
			<?php
				for($i=1;$i<=12;$i++){ 
				
					if($i<10) $i="0".$i;
				?>
				<option value="<?php echo $i;?>" <?php if($i==$isMonth) { echo 'selected="selected"';}?>><?php echo $i;?></option>
			<?php }?>	
		  
		 
	  </select>
	  
	  <select class="show-info-year  form-control  input-sm" id="isYeah">
		  <option value="<?php echo date('Y')?>"><?php echo date('Y')?></option>
	  </select>
    </div>
  </div>
  
</form>
<div class="success" >
	<?php if(count($data)>0){?>
<table class="table table-striped table-bordered ">
	  <tr>
			<td>Giải DB</td>
			<td><?php echo $data['AWARD_0']?></td>
	  </tr>
	  
	   <tr>
			<td>Giải 1</td>
			<td><?php echo $data['AWARD_1']?></td>
	  </tr>
	  
	  <tr>
			<td>Giải 2</td>
			<td><?php echo $data['AWARD_2']?></td>
	  </tr>
	  <tr>
			<td>Giải 3</td>
			<td><?php echo $data['AWARD_3']?></td>
	  </tr>
	  <tr>
			<td>Giải 4</td>
			<td><?php echo $data['AWARD_4']?></td>
	  </tr>
	  <tr>
			<td>Giải 5</td>
			<td><?php echo $data['AWARD_5']?></td>
	  </tr>
	  <tr>
			<td>Giải 6</td>
			<td><?php echo $data['AWARD_6']?></td>
	  </tr>
	  <tr>
			<td>Giải 7</td>
			<td><?php echo $data['AWARD_7']?></td>
	  </tr>
	   <tr>
			<td>Giải 8</td>
			<td><?php echo $data['AWARD_8']?></td>
	  </tr>
</table>
<?php } else echo "Không tìm thấy dữ liệu";?>

</div>
	
</div>